package com.spsy.pay.controller.api;

import com.alibaba.fastjson2.JSON;
import com.spsy.common.core.domain.R;
import com.spsy.common.vo.OrderReq;
import com.spsy.pay.api.SpsyPayProvider;
import com.spsy.pay.service.PayOptsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * 提供二维码
 * @author: liuzhiping
 * @date: 2025/1/15 15:39
 **/
@RestController
@Slf4j
public class PayOpenfeignApiController implements SpsyPayProvider {

    @Autowired
    private PayOptsService payOptsService;


    @Override
    public R payOrder(String orderId) {

        log.info("====支付系统请求微信获取二维码 orderId:{}",orderId);

        return this.payOptsService.pay(orderId);

    }

    @Override
    public R payOrder(OrderReq orderReq) {
        log.info("pay 参数对象 orderReq:{}", JSON.toJSONString(orderReq));
        return R.ok();
    }
}
